//
//  sendLogin.m
//  tcpoctest
//
//  Created by gump on 5/16/13.
//  Copyright (c) 2013 gump. All rights reserved.
//

#import "sendLogin.h"

#import "makeuid.h"

@implementation sendLogin

-(void)sendLoginByMail:(NSString *)mail withPS:(NSString *)ps
{
    if ([self CheckLogin]) {
        return;
    }
    
    NSString * uid = [[makeuid sharedmake] getui];
    
    UID_LOG(@"login uid %@",uid);
    
    int l = NAME_PL + CHAR_PL * 3 + [mail length] + INT_PL +
    CHAR_PL * 2 + [uid length];
    
    [self initDataByLength:l];
    
    [sb WriteChar:[mail length]];
    
    [sb WriteString:mail withLength:[mail length]];
    [sb WriteString:ps withLength:NAME_PL];
    
    [sb WriteChar:1];
    [sb WriteChar:[uid length]];
    [sb WriteString:uid withLength:[uid length]];
    
    [self Package];
}

@end
